#!/bin/bash
set -e

BINARY="./vdrift"

if [ ! -f "$BINARY" ]; then
  echo "Error: $BINARY not found. Build it first: go build -o vdrift ./cmd/vdrift"
  exit 1
fi

echo "Setting capabilities for $BINARY..."
sudo setcap cap_net_admin,cap_net_raw+ep "$BINARY"
echo "Capabilities set. You can now run without root:"
echo "    ./vdrift -c config.yaml"